package com.lagou.server;
import com.lagou.model.UserMessage;

import java.io.IOException;

/**
 * @Author: lu
 * @Date: 2021/10/10 20:21
 * @Description:编程实现服务器的功能
 */
public class ServerView {
    /**
     * 使用合成复用原则
     */
    private ServerInitClose sic;
    public ServerView(ServerInitClose sic) {
        this.sic = sic;
    }
    /**
     * 自定义成员方法实现客户端发来消息的接收
     */
    public void serverReceive() throws IOException, ClassNotFoundException {
        UserMessage u1 = (UserMessage) sic.getOis().readObject();
        System.out.println("接收到的消息是："+u1);
    }
}
